﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace WXWorkSvc.Common.Migrations
{
    /// <inheritdoc />
    public partial class t300 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Loggers_AppId_Name_LogLevel",
                table: "Loggers");

            migrationBuilder.AlterColumn<int>(
                name: "Roles",
                table: "PrivateUsers",
                type: "int",
                nullable: false,
                defaultValue: 0,
                oldClrType: typeof(string),
                oldType: "nvarchar(max)",
                oldNullable: true);

            migrationBuilder.CreateIndex(
                name: "IX_Loggers_AppId_Name",
                table: "Loggers",
                columns: new[] { "AppId", "Name" });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropIndex(
                name: "IX_Loggers_AppId_Name",
                table: "Loggers");

            migrationBuilder.AlterColumn<string>(
                name: "Roles",
                table: "PrivateUsers",
                type: "nvarchar(max)",
                nullable: true,
                oldClrType: typeof(int),
                oldType: "int");

            migrationBuilder.CreateIndex(
                name: "IX_Loggers_AppId_Name_LogLevel",
                table: "Loggers",
                columns: new[] { "AppId", "Name", "LogLevel" });
        }
    }
}
